home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 5.5 KB | 205 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: SLBitmap.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 -1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef SLBITMAP_H
- #define SLBITMAP_H
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- #ifndef SLGRDEF_H
- #include "SLGrDef.h"
- #endif
-
- #ifndef SLPTRECT_H
- #include "SLPtRect.h"
- #endif
-
- #ifndef SLPICTUR_H
- #include "SLPictur.h"
- #endif
-
- #ifndef SLPALETE_H
- #include "SLPalete.h"
- #endif
-
- #ifndef SLSTRMRW_H
- #include "SLStrmRW.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_OResourceFile;
- struct FW_SGraphicContext;
-
- //========================================================================================
- // Bitmap
- //========================================================================================
-
- class FW_CPrivBitmapRep;
- typedef FW_CPrivBitmapRep* FW_HBitmap;
-
- // Export or Import functions for CFM-68K [sfu]
-
- #if defined(FW_ODFLIB_IMPORT)
- #pragma import on
- #elif defined(FW_ODFLIB)
- #pragma export on
- #endif
-
- FW_EXTERN_C_BEGIN
-
- // Creation
-
- FW_HBitmap SL_API FW_PrivBitmap_CreateFromBits(
- short width, short height, short pixelSize, FW_Palette palette,
- void* image, long imageSize, short rowBytes,
- FW_PlatformError* error);
-
- FW_HBitmap SL_API FW_PrivBitmap_CreateFromPlatformBitmap(
- FW_PlatformBitmap platformBitmap,
- FW_PlatformError* error);
-
- FW_HBitmap SL_API FW_PrivBitmap_CreateFromResource(
- FW_OResourceFile* resourceFile,
- FW_ResourceID resID,
- FW_PlatformError* error);
-
- FW_HBitmap SL_API FW_PrivBitmap_Copy(FW_HBitmap bitmap,
- const FW_SRect& srcRect,
- FW_PlatformError* error);
-
- // Common operations
-
- FW_Boolean SL_API FW_PrivBitmap_IsEqual(FW_HBitmap bitmap,
- FW_HBitmap bitmap2);
-
- // Streaming
-
- FW_HBitmap SL_API FW_PrivBitmap_Read(
- FW_HReadableStream stream,
- FW_Boolean bDIBFileHeader,
- FW_PlatformError* error);
-
- void SL_API FW_PrivBitmap_Write(FW_HBitmap bitmap,
- FW_HWritableStream stream,
- FW_Boolean bDIBFileHeader,
- FW_PlatformError* error);
-
- // Reference counting
-
- void SL_API FW_PrivBitmap_Acquire(FW_HBitmap bitmap);
- long SL_API FW_PrivBitmap_GetRefCount(FW_HBitmap bitmap);
- void SL_API FW_PrivBitmap_Release(FW_HBitmap bitmap);
-
- // Handle operations
-
- FW_PlatformBitmap SL_API FW_PrivBitmap_GetPlatformBitmap(FW_HBitmap bitmap);
- FW_Boolean SL_API FW_PrivBitmap_IsPlatformBitmapOrphan(FW_HBitmap bitmap);
- FW_PlatformBitmap SL_API FW_PrivBitmap_OrphanPlatformBitmap(FW_HBitmap bitmap);
-
- FW_PlatformError SL_API FW_PrivBitmap_SetPlatformBitmap(FW_HBitmap bitmap,
- FW_PlatformBitmap newBitmap);
- FW_PlatformError SL_API FW_PrivBitmap_AdoptPlatformBitmap(FW_HBitmap bitmap,
- FW_PlatformBitmap newBitmap);
-
- // Palette
-
- FW_Palette SL_API FW_PrivBitmap_GetPalette(FW_HBitmap bitmap,
- FW_PlatformError* error);
- FW_PlatformError SL_API FW_PrivBitmap_SetPalette(FW_HBitmap bitmap,
- FW_Palette palette);
-
- // Bitmap info
-
- FW_PlatformError SL_API FW_PrivBitmap_GetBitmapInfo(FW_HBitmap bitmap,
- short& width,
- short& height,
- short& rowBytes,
- short& pixelSize);
-
- void SL_API FW_PrivBitmap_GetBitmapBoundsGC(Environment* ev,
- FW_HBitmap bitmap,
- FW_SGraphicContext& gc,
- FW_SRect& bounds);
- void SL_API FW_PrivBitmap_GetBitmapBounds(FW_HBitmap bitmap,
- FW_SRect& bounds);
-
- // Pixel manipulation
-
- void SL_API FW_PrivBitmap_GetPixelColor(FW_HBitmap bitmap,
- short horiz, short vert, FW_SColor& color);
- void SL_API FW_PrivBitmap_SetPixelColor(FW_HBitmap bitmap,
- short horiz, short vert, const FW_SColor& color);
-
- // Changing the bitmap
-
- FW_PlatformError SL_API FW_PrivBitmap_ChangeBitmap(FW_HBitmap bitmap,
- void* image,
- long imageSize,
- short rowBytes,
- short width,
- short height,
- short pixelSize,
- FW_Boolean bScale);
-
- FW_PlatformError SL_API FW_PrivBitmap_ChangeBitmapGeometry(FW_HBitmap bitmap,
- short width,
- short height,
- short pixelSize,
- FW_Boolean bScale);
-
- FW_PlatformError SL_API FW_PrivBitmap_SetImage(FW_HBitmap bitmap,
- void* image,
- long imageSize,
- short rowBytes);
-
- // Copy Pixels
-
- FW_PlatformError SL_API FW_PrivBitmap_CopyPixels(FW_HBitmap bitmapSrc,
- FW_HBitmap bitmapDst,
- FW_SRect& boundsSrc,
- FW_SRect& boundsDst);
-
- // Macintosh specific
-
- #ifdef FW_BUILD_MAC
-
- // Conversion
-
- FW_HBitmap SL_API FW_PrivBitmap_MacCreateFromPicture(FW_HPicture picture,
- FW_SColor fillColor,
- const FW_SRect& pictPart,
- FW_PlatformError* error);
-
- FW_HPicture SL_API FW_PrivBitmap_MacGetAsPicture(FW_HBitmap bitmap,
- const FW_SRect& bounds,
- FW_PlatformError* error);
-
- PixMapHandle SL_API FW_PrivBitmap_MacLockPixels(FW_HBitmap bitmap); // return NULL if fails
- FW_PlatformError SL_API FW_PrivBitmap_MacUnlockPixels(FW_HBitmap bitmap);
- FW_Boolean SL_API FW_PrivBitmap_MacIsPixelsLocked(FW_HBitmap bitmap);
-
- #endif
-
- FW_EXTERN_C_END
-
- // For CFM-68K [sfu]
-
- #if defined(FW_ODFLIB_IMPORT)
- #pragma import off
- #elif defined(FW_ODFLIB)
- #pragma export off
- #endif
-
- #endif // SLBITMAP_H
-